﻿function ResizeIFrame(contentHeight) {
    var tabHeight = $("#ctl02_TC").height() + 3;
    var tableHeight = contentHeight - tabHeight;
    $("#ctl02_CC").children().height(tableHeight);
    //$("#ctl02_C0").height(tableHeight);
    if ($("#iframeGrid").length == 1) {
        try {
            $("#iframeGrid")[0].contentWindow.ResizeIFrame(tableHeight);
        } catch (e) { }
    }
}
$("#ctl02_CC").children().height(100);


function TabClick(s, e) {
    if (e.tab.index != 0) {
        var iframe = $(s.mainElement).find("tbody > tr:eq(1) > td > div:eq("+e.tab.index+") > iframe");
        if (iframe.attr("url")) {
//            parent.parent.parent.aspxLoadpanel.Show();
            iframe.attr("src", iframe.attr("url"));
            iframe.removeAttr("url");
//            if (iframe.attachEvent) {
//                iframe.attachEvent("onload", function () {
//                    parent.parent.parent.aspxLoadpanel.Hide();
//                    //alert("Local iframe is now loaded."); 
//                });
//            } else {
//                iframe.onload = function () {
//                    parent.parent.parent.aspxLoadpanel.Hide();
//                    //alert("Local iframe is now loaded."); 
//                }
//            }

            
        };
    }
}